#lang racket


(require "../base/main.rkt")

(require "global.rkt")

(provide partial-derivative
         differenciate-tangent)


(define (partial-derivative proc uf vf ui vi delta)
  (mult-c (sub-c (proc uf vf) (proc ui vi)) (/ delta)))

(define (differenciate-tangent fn u v (delta differenciation-delta))
  (list
   (partial-derivative fn (+ u delta) v u v delta)
   (partial-derivative fn u (+ v delta) u v delta)))